var sql = require('mssql');
var config=require('./config');
var config = {
    user: 'sa',
    password: config.password,
    //192.168.199.207
    //192.168.247.88  内网
    //192.168.47.217  外网
    server: config.server, // You can use 'localhost\\instance' to connect to named instance
    database: 'PX',

    options: {
        encrypt: true // Use this if you're on Windows Azure
    }
}
var request;
var connection = new sql.Connection(config, function(err) {
    request = new sql.Request(connection); // or: var request = connection.request();

});
module.exports=function conn(sqlstr,callback){
    request.query(sqlstr, function(err, results) {
        // ... error checks
        if(!results){
            results=[];
        }
        callback(err,results)
    });
}



